package com.monster.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * description:
 *
 * @author Yuanml on 2021/4/11 14:10
 */
@Data
public class Person {
    private Integer age;
    private String name;
    private String gender;
    private static Random random = new Random();

    public static List<Person> getPersonList(int num) {
        List<Person> list = new ArrayList<>(num);
        for (int i = 0; i < num; i++) {
            Person person = new Person();
            person.setAge(random.nextInt(50));
            person.setName("name" + i);
            person.setGender(i % 2 == 0 ? "男" : "女");
            list.add(person);
        }
        return list;
    }
}
